package com.platform.wechat.service.impl;

import com.platform.wechat.common.JsonBean;
import com.platform.wechat.mapper.OfficesMapper;
import com.platform.wechat.service.OfficeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author YP
 * @company ~~
 * @create 2021-07-28 13:43
 */
@Service
public class OfficeServcieImpl implements OfficeService {

    @Autowired
    private OfficesMapper officesMapper;

    /**
     * 根据主科室id查询科室信息
     * @param chiefofficesId
     * @return
     */
    @Override
    public JsonBean selectByParentId(Integer chiefofficesId) {
        return new JsonBean(0, "ok", officesMapper.selectByParentId(chiefofficesId));
    }

    /**
     * @Description: 根据医院id查询科室信息
     * @Param: [hospitalId]
     * @return: com.platform.wechat.common.JsonBean
     * @Author: MaYongQiang
     * @Date: 2021/7/28
     * @time: 17:16
     */
    @Override
    public JsonBean selectInHospitalById(Integer hospitalId) {
        return new JsonBean(0,"ok",officesMapper.selectInHospitalById(hospitalId));
    }

    /**
    * @Date: 2021/8/1 23:12
    * @Author: guopeixin
    * @Description:  查一个通过officesId
    */
    @Override
    public JsonBean selectOneByOfficesId(Integer officesId) {

        return new JsonBean(0,"ok",officesMapper.selectByPrimaryKey(officesId));
    }


}
